package com.heima.admin.controller;

import com.heima.admin.dto.LoginDto;
import com.heima.admin.service.IAdUserService;
import com.heima.common.dto.ResponseResult;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("login")
public class LoginController {
    @Autowired
    private IAdUserService userService;
    /**
     * 登录
     * 请求路径：/in
     * 请求方式：POST
     * 参数：
     *      WmChannel
     * 响应结果：
     *      ResponseResult
     */
    @PostMapping("in")
    @ApiOperation(value = "登录",notes = "author:xdl")
    @ApiImplicitParam(name ="dto" ,value = "用户",required = true,dataType = "LoginDto")
    public ResponseResult login(@RequestBody LoginDto dto){
        return userService.login(dto);
    }
}
